<template>
	<view class="invite u-p-l-22 u-p-r-46">
		<template v-if="list.length > 0">
			<view class=" bd-b u-flex u-row-between u-col-center u-p-t-30 u-p-b-30" v-for="item in list">
				<view class="u-flex-col c93 u-font-22">
					<text class="u-m-b-22 gray u-font-30" v-if="typeNum == 1">{{item.describe}}</text>
					<text class="u-m-b-22 gray u-font-30" v-else>¥{{item.price}}</text>
					<text>{{item.create_time}}</text>
				</view>
				<view class="red u-font-32">
					<text v-if="typeNum == 1">{{item.money}}</text>
					<text v-else>{{item.state | stateFilter}}</text>
				</view>
			</view>
		</template>
		<template v-else>
			<u-empty text="记录为空" mode="list" :margin-top="60"></u-empty>
		</template>
	</view>
</template>

<script>
	export default {
		props: {
			typeNum: {
				type: Number,
				default: -1
			},
			list: {
				type: Array,
				default () {
					return []
				}
			}
		},
		mounted() {
			console.log(this.list)
		},
		methods: {

		},
		filters: {
			stateFilter(val) {
				let stateObj = {
					0 : '申请中',
					1 : '已打款',
					2 : '已拒绝',
				}
				return stateObj[val]
			}
		}
	}
</script>

<style lang="scss" scoped>
	.invite {
		width: 710upx;
		box-shadow: 0upx 5upx 15upx 12upx rgba(197, 197, 197, 0.1);
		border-radius: 20upx;
		background: #FFFFFF;
		margin: 20upx auto;

		.bd-b {
			border-bottom: 2upx solid #EEEEEE;
		}

		.c93 {
			color: #939393;
		}

		.red {
			color: #E10000;
		}

		.gray {
			color: #454545;
		}
	}
</style>
